package com.miluvs.config;

import io.milvus.client.ConnectParam;
import io.milvus.client.MilvusGrpcClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import io.milvus.client.MilvusClient;

@Configuration
public class MilvusConfig {
    @Value("${milvus.host}")
    private String host;

    @Value("${milvus.port}")
    private int port;

    @Bean
    public MilvusClient milvusClient() {
        ConnectParam connectParam = new ConnectParam.Builder()
                .withHost(host)
                .withPort(port)
                .build();
        return new MilvusGrpcClient(connectParam);
    }
}